const fs = require('fs')

const filepath = 'test.txt'
const content = 'writeFile\n'

// 文件写入
// fs.writeFile(filepath, content, {flag: 'a'}, err => {
//   console.log(err)
// })

// 文件读取
fs.readFile(filepath, {encoding: 'utf-8'}, (err, data) => {
  if(err) {
    console.log(err)
    return
  }
  console.log(data)
})